package org.hfy.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 合同实体类
 * 
 * @author hfy
 * @version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("contracts")
public class Contract extends BaseEntity {

    /**
     * 合同编号
     */
    @NotBlank(message = "合同编号不能为空")
    @Size(max = 50, message = "合同编号长度不能超过50个字符")
    @TableField("contract_no")
    private String contractNo;

    /**
     * 报价单ID
     */
    @NotNull(message = "报价单ID不能为空")
    @TableField("quotation_id")
    private Long quotationId;

    /**
     * 合同内容(HTML)
     */
    @TableField("contract_content")
    private String contractContent;

    /**
     * PDF文件路径
     */
    @Size(max = 255, message = "PDF文件路径长度不能超过255个字符")
    @TableField("pdf_path")
    private String pdfPath;

    /**
     * 审核状态
     */
    @TableField("status")
    private String status;

    /**
     * 审核人
     */
    @Size(max = 50, message = "审核人长度不能超过50个字符")
    @TableField("audit_by")
    private String auditBy;

    /**
     * 审核时间
     */
    @TableField("audit_time")
    private LocalDateTime auditTime;

    /**
     * 审核备注
     */
    @TableField("audit_remark")
    private String auditRemark;

    /**
     * 报价单信息 (非数据库字段)
     */
    @TableField(exist = false)
    private Quotation quotation;
} 